%nav.navbar.navbar-themed-colors.fixed-top
  .container-fluid.d-flex.flex-nowrap.justify-content-between.w-100
    = link_to(root_path, class: 'navbar-brand', alt: 'Logo') do
      = image_tag(::Configuration.logo.attached? ? ::Configuration.logo : 'obs-logo_small.svg')
    .d-flex.nav
      = render partial: 'layouts/webui/top_navigation_search'
      - if User.session
        .toggler.text-center.justify-content-center.nav-item
          = link_to('javascript:void(0)', class: 'nav-link p-0 w-100', alt: 'Watchlist', data: { toggle: 'watchlist' }) do
            %i.far.fa-eye
            %span.d-block Watchlist
        .toggler.text-center.justify-content-center.nav-item
          = link_to(my_notifications_path, id: 'top-notifications-counter', class: 'nav-link p-0 w-100', alt: 'Notifications') do
            = render partial: 'layouts/webui/unread_notifications_counter', locals: { unread_notifications_count: unread_notifications_count }
        .toggler.text-center.justify-content-center.nav-item.dropdown
          = link_to('#', class: 'nav-link dropdown-toggle', id: 'top-navigation-profile-dropdown', role: 'button',
                    'data-bs-toggle': 'dropdown', aria: { haspopup: true, expanded: false }) do
            = render(AvatarComponent.new(name: User.session.name, email: User.session.email, size: 32, shape: :circle, custom_css: 'me-2'))
          %ul.dropdown-menu.dropdown-menu-end{ 'aria-labelledby': 'top-navigation-profile-dropdown' }
            %li.dropdown-item
              = link_to(user_path(User.session), id: 'link-to-user-home', class: 'nav-link p-0 w-100') do
                %i.fas.fa-user.fa-fw.me-2
                Your Profile
            %li.dropdown-item
              = link_to(my_requests_path, class: 'nav-link p-0 w-100') do
                %i.fas.fa-code-pull-request.fa-fw.me-2
                Your Requests
            - if User.session.home_project
              %li.dropdown-item
                = link_to(project_show_path(User.session.home_project), class: 'nav-link p-0 w-100') do
                  %i.fas.fa-cubes.fa-fw.me-2
                  Your Home Project
            %li.dropdown-item
              = link_to(my_subscriptions_path, class: 'nav-link p-0 w-100') do
                %i.fas.fa-code-pull-request.fa-fw.me-2
                Your Subscriptions
            %li.dropdown-item
              = link_to(tokens_path, class: 'nav-link p-0 w-100') do
                %i.fas.fa-key.fa-fw.me-2
                Your Tokens
            %li.dropdown-item
              = link_to(my_beta_features_path, class: 'nav-link p-0 w-100') do
                %i.fas.fa-flask.fa-fw.me-2
                Your Beta Features
            %li.dropdown-item
              = link_to(canned_responses_path, class: 'nav-link p-0 w-100') do
                %i.fas.fa-comment-dots.fa-fw.me-2
                Your Responses
            %li
              %hr.dropdown-divider
            %li.dropdown-item
              = link_to(log_out_url, id: 'logout-link', class: 'nav-link p-0 w-100') do
                %i.fas.fa-sign-out-alt.fa-fw.me-2
                Logout
      - else
        = render partial: 'layouts/webui/top_navigation_nobody'

- if User.possibly_nobody.nobody?
  - if !::Configuration.proxy_auth_mode_enabled? && can_sign_up?
    = render partial: 'layouts/webui/sign_up_modal'
  = render partial: 'layouts/webui/login_modal'
